
function AllReady() {
    var mstform = Ext.getCmp('CzActM');//获取容器，改一下对应的容器名即可
    var dgrid = Ext.getCmp('CzActDList');//获取容器，改一下对应的容器名即可
    var dStore=dgrid.getStore();
    var PhidYsfl = mstform.queryById('PhidYsfl');
    var tabPanel = Ext.getCmp("tabPanelcz");
    var tabSum = tabPanel.items.find(function (item) {
        return item.id === "tabSum";
    });
    tabSum.tab.onHide();
    if (otype == 'add') {
        PhidYsfl.setValue('14')
        BatchBindCombox([PhidYsfl])

    }

    mstform.getItem("PhidPc").addListener("helpselected", function () {
        execServer(
            "GetCzQd",
            { pc: mstform.getItem("PhidPc").getValue() },
            function (res) {
                console.log(res); // 打印整个响应对象以便调试
                const parsedData = JSON.parse(res.data);

                if (parsedData.length > 0) {
                    var arr = [];
                    for (let i = 0; i < parsedData.length; i++) {
                        const record = parsedData[i].extendObjects;
                        arr.push({
                            user_equipment_list_no: record.sbqd_no,
                            user_equipment_list_name: record.sbqdid,
                            user_equipment_list_name_EXName: record.sbqd_name,
                            user_model: record.spec,
                            user_tech_params: record.jscs,
                            user_cnt_qty: record.ht_qty,
                            user_detailed_qty: record.sh_qty,
                            user_taxrate: record.taxrate,
                            UnitName: record.msunit,
                            UnitName_EXName: record.msname,
                            ConQty: record.bqsl,
                            Qty: record.bqsl,
                            ConAmt: record.bqsl * record.prc,
                            Amt: record.bqsl * record.prc,

                        });
                    }
                    console.log(arr)
                    // dstore.removeAll(); //清除单据体内所有数据
                    dStore.insert(dStore.getCount(), arr); //将服务端获取的数组内容插入到单据体
                }

            }
        );


    });



}





